#ifndef SLICENODE_H
#define SLICENODE_H

#include <osg/ref_ptr>
#include <osg/Geode>
#include <osg/Geometry>
#include <osg/Material>
#include <osg/MatrixTransform>
#include <QPoint>
#include <QVector>
#include <QMap>

namespace HIM {
class SliceNode
{
public:
    SliceNode();

    osg::ref_ptr<osg::Geode> getSliceNode(){return sliceNode_;};

    void setLineWidth(float Width);
    void updataSliceNode(float zPos ,const QMap<int,QVector<QPair<QPointF,QPointF>>>& lineList);
    void clearSliceNode();
    void moveSliceNode(float x,float y,float z);
    void addToSliceNode();
private:
    osg::ref_ptr<osg::Geode> sliceNode_;
    osg::ref_ptr<osg::MatrixTransform> tr_ ;
    osg::ref_ptr<osg::Geometry> sliceGeom_; 

    osg::Vec4 colorRing[12]{osg::Vec4(1.,0.0,0,1),osg::Vec4(0,0,1,1),osg::Vec4(1,0.4,0,1),
                osg::Vec4(0,0.8,1,1),osg::Vec4(1,0.8,0,1),osg::Vec4(0,1,1,1),
                osg::Vec4(1,1,0,1),osg::Vec4(0.8,1,0,1),osg::Vec4(0.4,1,0,1),
                osg::Vec4(0,1,0,1),osg::Vec4(0,1,0.4,1),osg::Vec4(0,1,0.8,1)};
};
}

#endif // SLICENODE_H
